|
|
|
|
|
|
|
(table continued from previous page) |
|
|
|
|
| Property | Description | | RecordCount | This property is set to the number of records in the recordset. This property might not be available immediately after opening the data control. All records in the recordset need to be read before this will have a true count of the records. The only reliable way to ensure this is accurate, is to scroll all the way through the records until you hit the EOF. |
|
|
|
|
|
|
Check for Beginning and End of File |
|
|
|
|
|
|
|
|
When youre using the Recordset property, youll be constantly checking to see where you are within the recordset. As you move forward and backward through this cursor, you may eventually hit the beginning or the end of the file. Youll use the BOF and EOF properties to check for these conditions. Table 13.2 shows the different values that these properties can have, as well as what they mean when taken together. |
|
|
|
|
| Table 13.2 BOF and EOF Properties. | | BOF Value | EOF Value | Description | | True | False | The record pointer is before the first record in the recordset. | | False | True | The record pointer is after the last record in the recordset. | | True | True | There are no rows at all in the recordset. | | False | False | The current record is valid. However, if youve just deleted the current record and have not moved to a new record, these properties will not be changed, and youre on an invalid record. |
|
|
|
|
|
|
Methods of the Recordset Object |
|
|
|
|
|
|
|
|
Using the Recordset property of the data control, you can programmatically control the operation of the Recordset object to move, add, edit, delete, and validate the data in the recordset. Table 13.3 is a list of the most common methods used with the Recordset property to perform these operations. |
|
|
|
|
|